﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SkuOrderSendGoods.aspx.cs"
    Inherits="ZLCMS.Web.SystemManage.Basics.SkuOrderSendGoods" %>

<form id="shippingDialog" runat="Server" class="pageForm required-validate">
<!-- 需保存的全局变量 -->
<asp:label runat="server" id="_oid" visible="False"></asp:label>
<div class="pageContent">
    <div class="pageFormContent" layouth="56">
        <dl class="nowrap">
            <dt>订单编号：</dt>
            <dd>
                <%=_orderDb.OrderNo %></dd>
        </dl>
        <dl class="nowrap">
            <dt>商品选择：</dt>
            <dd>
                <asp:dropdownlist runat="server" id="ddl_productlist" onchange="setDefaultCom($(this).val())"
                    prop="ProductSkuNo"></asp:dropdownlist>
            </dd>
        </dl>
        <dl class="nowrap">
            <dt>商品数量：</dt>
            <dd>
                <input type="text" width="100px" prop="Count">
            </dd>
        </dl>
        <dl class="nowrap">
            <dt>快递公司：</dt>
            <dd>
                <asp:dropdownlist runat="server" id="ddl_shippinglist" onchange="setComName($(this).val())"
                    prop="ShippingComNo"></asp:dropdownlist>
                <input type="hidden" width="100px" id="ComName" prop="ShippingComName">
            </dd>
        </dl>
        <dl class="nowrap">
            <dt>快递单号：</dt>
            <dd>
                <asp:textbox id="tb_shippingno" width="200px" runat="server" prop="ShippingNo"></asp:textbox>
            </dd>
        </dl>
        <dl class="nowrap">
            <dt>备注：</dt>
            <dd>
                <asp:textbox id="tb_memo" runat="server" width="200px" prop="Memo"></asp:textbox>
            </dd>
        </dl>
                <asp:textbox id="tb_productName" runat="server" width="200px" prop="ProductName" style="display:none"></asp:textbox>
    </div>
    <div class="formBar">
        <ul>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="button" onclick="return saveShippingItem()" class="close">
                            保存</button></div>
                </div>
            </li>
            <li>
                <div class="button">
                    <div class="buttonContent">
                        <button type="button" class="close">
                            取消</button></div>
                </div>
            </li>
        </ul>
    </div>
</div>
</form>
<script type="text/javascript">
    initializeGridItemInDialog($('#shippingDialog'), <%=Request["object"] %>);
    $("#tb_productName", $.pdialog.getCurrent()).val($("#ddl_productlist", $.pdialog.getCurrent()).find('option[value=' + $("#ddl_productlist", $.pdialog.getCurrent()).val() + ']').text());
    
     function setComName(selectedVal) {
    $("#ComName", $.pdialog.getCurrent()).val($("#ddl_shippinglist", $.pdialog.getCurrent()).find('option[value=' + selectedVal + ']').text());
    };
       function setDefaultCom(selectedVal) 
       {
//        if (selectedVal == 'NO00000000232_SKUNO0000000551') 
//        {
//            $("#ddl_shippinglist", $.pdialog.getCurrent()).val('shunfeng');
//            $("#ComName", $.pdialog.getCurrent()).val($("#ddl_shippinglist", $.pdialog.getCurrent()).find('option[value=shunfeng]').text());
//        }
        $("#tb_productName", $.pdialog.getCurrent()).val($("#ddl_productlist", $.pdialog.getCurrent()).find('option[value=' + selectedVal + ']').text());
//    
       };
    function saveShippingItem(){
        var val = $('#shippingDialog').find('[prop=ShippingNo]').val();
        if(val == ''){
            $('#shippingDialog').find('[prop=ShippingNo]').val(new Date().valueOf());
        }
        return saveDialogDataAsDialogResult($('#shippingDialog'));
    };
</script>
